<!DOCTYPE html>
<html>
  <head>
    <title>追加补偿登记</title>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <link rel="stylesheet" href="${s.base}/mobile/lib/weui.min.css">
    <link rel="stylesheet" href="${s.base}/mobile/css/jquery-weui.css">
    <link rel="stylesheet" href="${s.base}/mobile/css/base.css">
      <link rel="stylesheet" href="${s.base}/mobile/lib/Mdate/needcss/Mdate.css">
  </head>
  <body>
	<div class="xyg-comp-list-select">
        <div class="xyg-comp-list-select-item">
            <div class="xyg-comp-list-select-item-title">
                <span style="color: #F00;">*</span>客服名
            </div>
            <input type="hidden" id="customId" value=""/>
            <div class="xyg-comp-list-select-item-icon" id="customSelect">
                <span>请选择</span>
                <svg class="icon" aria-hidden="true">
                    <use xlink:href="#icon-xiangyou"></use>
                </svg>
            </div>
        </div>
        <div class="xyg-comp-list-select-item">
            <div class="xyg-comp-list-select-item-title">
                <span style="color: #F00;">*</span>旺旺号
            </div>
             <div class="xyg-comp-list-select-item-content"> 
             <input type="text" maxlength="20" id="wangWang" placeholder="请先填写旺旺号" />
            </div>
       </div>
        <div class="xyg-comp-list-select-item">
            <div class="xyg-comp-list-select-item-title">
                <span style="color: #F00;">*</span>订单编号
            </div>
            <div class="xyg-comp-list-select-item-content">
                <input type="text" maxlength="20" id="orderNum" placeholder="请先填写订单编号" />
            </div>
        </div>
        <div class="xyg-comp-list-select-item">
            <div class="xyg-comp-list-select-item-title">
                <span style="color: #F00;">*</span>微信号
            </div>
            <div class="xyg-comp-list-select-item-content">
                <input type="text" maxlength="20" id="weChat" placeholder="请先填写微信号" />
            </div>
        </div>
        <div class="xyg-comp-list-select-item">
            <div class="xyg-comp-list-select-item-title">
                <span style="color: #F00;">*</span>返款金额
            </div>
            <div class="xyg-comp-list-select-item-content">
                <input type="number" maxlength="11" id="money" placeholder="请先填写返款金额" />
            </div>
        </div>

        <div class="xyg-comp-list-select-item">
            <div class="xyg-comp-list-select-item-title">
                <span style="color: #F00;">*</span>返款原因
            </div>
            <input type="hidden" id="reason" value=""/>
            <div class="xyg-comp-list-select-item-icon" id="reasonSelect">
                <span>请选择</span>
                <svg class="icon" aria-hidden="true">
                    <use xlink:href="#icon-xiangyou"></use>
                </svg>
            </div>
        </div>
        <div class="xyg-comp-list-select-item" style="height: 120px;">
            <div class="xyg-comp-list-select-item-title">
                <span style="color: #F00;">*</span>微信收款码
            </div>
            <div class="xyg-comp-list-select-item-content"  style="height:100px; padding: 10px 0px;">
                <div class="famous-upload-pic">
                    <img  src="/image/icon_addpic.png" class="upload-avatar" id="skmShow"/>
                    <input type="file" name="myfiles" class="upload" id="myFileEwm" onchange="ajaxFileUploads('myFileEwm','skm','skmShow')">
                    <input type="hidden" id="skm"  value=""/>
                </div>
            </div>
        </div>
        <div class="xyg-comp-list-select-item">
            <div class="xyg-comp-list-select-item-title">
                <span style="color: #F00;">*</span>是否返款
            </div>
            <input type="hidden" id="backMoney" value="否"/>
            <div class="xyg-comp-list-select-item-icon" id="backMoneySelect">
                <span>否</span>
                <svg class="icon" aria-hidden="true">
                    <use xlink:href="#icon-xiangyou"></use>
                </svg>
            </div>
        </div>
        <!--<div class="xyg-comp-list-select-item">
            <div class="xyg-comp-list-select-item-title">
                <span style="color: #F00;">&nbsp;&nbsp;</span>返款日期
            </div>
            <div class="xyg-comp-list-select-item-content">
                <input type="text"  id="returnDate" placeholder="请先填写返款日期" />
            </div>
        </div>
        <div class="xyg-comp-list-select-item">
            <div class="xyg-comp-list-select-item-title">
                <span style="color: #F00;">&nbsp;&nbsp;</span>返款银行
            </div>
            <div class="xyg-comp-list-select-item-content">
                <input type="text" maxlength="100" id="returnBank" placeholder="请先填写返款银行" />
            </div>
        </div>-->
        <div class="xyg-comp-list-select-item">
            <div class="xyg-comp-list-select-item-title">
                <span style="color: #F00;">&nbsp;&nbsp;</span>备注
            </div>
            <div class="xyg-comp-list-select-item-content">
                <input type="text" maxlength="200" id="remark" placeholder="请先填写备注" />
            </div>
        </div>

        <div class="xyg-comp-list-select-item">
            <div class="xyg-comp-list-select-item-title">
                <span style="color: #F00;">*</span>月份
            </div>
            <input type="hidden" id="month" value=""/>
            <div class="xyg-comp-list-select-item-icon" id="monthSelect">
                <span id="monthShow">请选择</span>
                <svg class="icon" aria-hidden="true">
                    <use xlink:href="#icon-xiangyou"></use>
                </svg>
            </div>
        </div>


    </div>
   <div class="xyg-bottom">
    	<a href="javascript:void(0);" id="submitBtn" class="weui-btn weui-btn_primary">提交</a>
    </div>
  <style type="text/css">
	  html,body{background:#f5f5f5;}
  	.xyg-comp-list-select{width:100%; height:auto;}
	.xyg-comp-list-select-item{width:100%; padding:0px 5%; line-height:2.2rem; height:2.2rem;font-size: 0.8rem; color:#000; letter-spacing: 0.01rem; background: #FFF; border: 0.001rem solid #f5f5f5;}
	.xyg-comp-list-select-item .xyg-comp-list-select-item-icon{width:70%; line-height:2rem; text-align:right; float:left;}
	.xyg-comp-list-select-item .xyg-comp-list-select-item-title{width:30%; height:2rem; text-align:left; float:left;}
	.xyg-comp-list-select-item .xyg-comp-list-select-item-content{width:70%; height:2rem; text-align:left; float:left;}
	.xyg-comp-list-select-item .xyg-comp-list-select-item-content input{width:100%; height:2rem; line-height:2rem;background-color:transparent;border:0; text-align:right;}
	.xyg-comp-xy{height:2rem; line-height:2rem; width:width:93%; margin:0px 2% 0px 5%;}
	.xyg-bottom{width:90%; height:auto;  margin:1.5rem 5%;}
      /***图片上传***/
      .famous-upload-pic{display:block; float: right; width: 100px; height: 100px; position: relative;}
      .famous-upload-pic .upload-avatar{display: block; width:100px;  height: 100px;  }
      .famous-upload-pic .upload{width:100px; height: 100px; opacity: 0; position: absolute; top: 0;}
      .famous-upload-pic .desc{font-size: 1.2rem; color: #666;}
  </style>
  </body>
  <script src="${s.base}/mobile/lib/jquery-2.1.4.js"></script>
  <script src="${s.base}/mobile/js/jquery-weui.js"></script>
  <script src="${s.base}/mobile/lib/Mdate/iScroll.js"></script>
  <script src="${s.base}/mobile/lib/Mdate/Mdate.js"></script>
  <script type="text/javascript" src="${s.base}/js/base/ajaxfileupload.js"></script>
  <script>
      //获取当前月份
      var myDate = new Date();
      if(myDate.getMonth()===0){
          //获取当前月份(0-11,0代表1月)
          $("#month").val("一月");
          $("#monthShow").html("一月");
      }else if(myDate.getMonth()===1){
          //获取当前月份(0-11,0代表1月)
          $("#month").val("二月");
          $("#monthShow").html("二月");
      }else if(myDate.getMonth()===2){
          //获取当前月份(0-11,0代表1月)
          $("#month").val("三月");
          $("#monthShow").html("三月");
      } else if(myDate.getMonth()===3){
          //获取当前月份(0-11,0代表1月)
          $("#month").val("四月");
          $("#monthShow").html("四月");
      }else if(myDate.getMonth()===4){
          //获取当前月份(0-11,0代表1月)
          $("#month").val("五月");
          $("#monthShow").html("五月");
      }else if(myDate.getMonth()===5){
          //获取当前月份(0-11,0代表1月)
          $("#month").val("六月");
          $("#monthShow").html("六月");
      }else if(myDate.getMonth()===6){
          //获取当前月份(0-11,0代表1月)
          $("#month").val("七月");
          $("#monthShow").html("七月");
      }else if(myDate.getMonth()===7){
          //获取当前月份(0-11,0代表1月)
          $("#month").val("八月");
          $("#monthShow").html("八月");
      }else if(myDate.getMonth()===8){
          //获取当前月份(0-11,0代表1月)
          $("#month").val("九月");
          $("#monthShow").html("九月");
      }else if(myDate.getMonth()===9){
          //获取当前月份(0-11,0代表1月)
          $("#month").val("十月");
          $("#monthShow").html("十月");
      }else if(myDate.getMonth()===10){
          //获取当前月份(0-11,0代表1月)
          $("#month").val("十一月");
          $("#monthShow").html("十一月");
      }else if(myDate.getMonth()===11){
          //获取当前月份(0-11,0代表1月)
          $("#month").val("十二月");
          $("#monthShow").html("十二月");
      }
      //new Mdate("returnDate", {format: "-"});
      $("#customSelect").select({
          title: "选择客服",
          items:${customs},
          onClose: function (d) {
              $("#customId").val(d.data.values);
              $("#customSelect span").html(d.data.titles);
          }
      });
      $("#reasonSelect").select({
          title: "选择原因",
          items: ["追加","补偿","运费","转发朋友圈","问答","拉群","其他"],
          onClose: function (d) {
              $("#reason").val(d.data.values);
              $("#reasonSelect span").html(d.data.values);
          }
      });
      $("#monthSelect").select({
          title: "选择月份",
          items: ["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],
          onClose: function (d) {
              $("#month").val(d.data.values);
              $("#monthSelect span").html(d.data.values);
          }
      });
      $("#backMoneySelect").select({
          title: "选择是否返款",
          items: ["否","是"],
          onClose: function (d) {
              $("#backMoney").val(d.data.values);
              $("#backMoneySelect span").html(d.data.values);
          }
      });
      $("#submitBtn").on("click",function(){
          var customId = $("#customId").val();
          if(customId == null || customId == "") {
              $.toast("请选择客服", "text");
              return false;
          }
          var wangWang = $("#wangWang").val();
          if(wangWang == null || wangWang == "") {
              $.toast("请填写旺旺号", "text");
              return false;
          }
          var orderNum = $("#orderNum").val();
          if(orderNum == null || orderNum == "") {
              $.toast("请填写订单号", "text");
              return false;
          }
          var weChat = $("#weChat").val();
          if(weChat == null || weChat == "") {
              $.toast("请填写微信号", "text");
              return false;
          }

          var money = $("#money").val();
          if(money == null || money == "") {
              $.toast("请填写返款金额", "text");
              return false;
          }
          var reason = $("#reason").val();
          if(reason == null || reason == "") {
              $.toast("请填写返款原因", "text");
              return false;
          }
          var backMoney = $("#backMoney").val();
          if(backMoney == null || backMoney == "") {
              $.toast("请选择是否返款", "text");
              return false;
          }
          var skm = $("#skm").val();
          if(skm == null || skm == "") {
              $.toast("请上传微信收款码", "text");
              return false;
          }
          //var returnDate = $("#returnDate").val();
          /*if(returnDate == null || returnDate == "") {
              $.toast("请填写返款日期", "text");
              return false;
          }*/
         // var returnBank = $("#returnBank").val();
         /* if(returnBank == null || returnBank == "") {
              $.toast("请填写返款银行", "text");
              return false;
          }*/

          var remark = $("#remark").val();
          var month = $("#month").val();
          if(month == null || month == "") {
              $.toast("请选择月份", "text");
              return false;
          }

          var param = {backMoney:backMoney,customId:customId,wangWang:wangWang,orderNum:orderNum,weChat:weChat,
              skm:skm,money:money*1,reason:reason,remark:remark,month:month};
          $.showLoading("正在提交中");
          $.post("/phone/compensateSave",param,function(result){
              $.hideLoading();
              if(1==result.returnInfo.state){
                  $.alert("您已经提交成功！", function() {
                      //点击确认后的回调函数
                      var timestamp = (new Date()).getTime();
                      //点击确认后的回调函数
                      window.location.href="/phone/compensate?"+timestamp;
                  });
              }else{
                  $.toast(result.returnInfo.errorMsg, "text");
              }
          },"json");
      });
  </script>
</html>

